<!DOCTYPE html>
<html id="myhtml" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
    <link rel="icon" type="image/x-icon" href="{{ asset('favicon64.ico') }}" />
    <title>{{ system_name|trans }} {{ version|raw|default('3.0.0') }}</title>
    <link type="text/css" rel="stylesheet" href="{{ asset('bundles/icsocui/css/animate.css') }}"/>
    <link type="text/css" rel="stylesheet" href="{{ asset('bundles/icsocui/css/login-all-min.css') }}"/>
    <link type="text/css" rel="stylesheet" href="{{ asset('bundles/icsocui/css/newlogin/bootstrap.min.css') }}"/>
    <link type="text/css" rel="stylesheet" href="{{ asset('bundles/icsocui/font-icon/iconfont.css') }}"/>
</head>
<body>
<div id="app">
    <div id="login-container" :style="banner.bgimg?'background-image:url('+banner.bgimg+')':''">
        <div class="header-container">
            <div id="login-header" class="w1200">
                <div class="logo"> <a class="ztth-logo" href="http://www.haixue.com/" target="_blank" title="嗨学网">嗨学网</a></div>
                <div class="login-title">
                    <p><i class="iconfont icon-dianhua1"></i><span class="login-txt">故障保修 :</span><span class="phone-title">18910540713（佟蒙）</span></p>
                    <p><i class="iconfont icon-youjian"></i><span class="login-txt">联系邮箱 :</span><span class="mail-title">yunweibu@haixue.com</span></p>
                </div>
            </div>
        </div>
        <!--BANNER-->
        <div class="login-main">
            <div class="all-index-banner animated fadeIn" v-for="(item,key) in banner.items" v-show="banner.active==key">
                <div class="index-body-content">
                    <img class="animated" v-for="el in item.elements" :src="el.imgurl" :style="el.style" :class="el.animate">
                </div>
            </div>
            <div class="yunbg">
                <ul class="focus-content clearfix">
                    <li class="focus-content-item" v-for="(item,key) in banner.items">
                        <a class="focus-anchor" :class="{current:banner.active==key}"></a>
                    </li>
                </ul>
            </div>
            <div id="login-middle">
                <div class="header-login">
                    <div class="pass-login-tab">
                        <!-- <div class="qcode-title rightline" id="qcode-title" :class='{active:loger.active==1}'><a href="javascript:;" @click="loger.active=1">易客通登录</a></div> -->
                        <!-- <div class="account-title" :class='{active:loger.active==0}'><a href="javascript:;" @click="loger.active=0">企业自助平台登录</a></div> -->
                        <div class="account-title">企业自助平台登录</div>
                    </div>
                    <!--企业自助平台登录-->
                    <div id="login2" class="loginbox login-get2" v-show="loger.active==0">
                        <ul>
                            <li>
                                <input type="text" id="vcc_code" name="vcc_code" {% if login_vcc != '' %} value="{{ login_vcc }}" {% endif %} placeholder="企业账号" />
                                <div id="vcccode_tip" style="display: none;"><i class="iconfont icon-tanhao"></i><span></span></div>
                            </li>
                            <li>
                                <input type="text" id="user_name" name="user_name" {% if login_user != '' %} value="{{ login_user }}" {% endif %} placeholder="用户名" />
                                <div id="username_tip" style="display: none;"><i class="iconfont icon-tanhao"></i><span></span></div>
                            </li>
                            <li>
                                <input type="password" id="password" name="password" placeholder="登录密码" />
                                <div id="password_tip" style="display: none;"><i class="iconfont icon-tanhao"></i><span></span></div>
                            </li>
                            <li>
                                <input type="text" placeholder="验证码" style="width: 190px;" id="captcha" />
                                <span style="display: inline-block; maring:0px; padding:0px; cursor: pointer;" title="看不清楚？点击更换另一个验证码"><img src="{{ path('gregwar_captcha.generate_captcha', {key:'login'}) }}" id="captcha_img" onclick="reload()" ></span>
                                <div id="captcha_tip" style="display: none;"><i class="iconfont icon-tanhao"></i><span></span></div>
                                </li>
                            <li>&nbsp;</li>
                            <li><button type="button" class="btn" id="btn_signin" onclick="sendData();">登录</button></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div id="linkbar" class="w1200">
        <ul class="linkbar-left clearfix">
            <li><a hidefocus="true" href="http://www.haixue.com/help/newsdt-vision.html" target="_blank"><i class="iconfont icon-guanyuwomen01"></i>公司简介</a></li>
            <!-- <li><a hidefocus="true" href="http://www.icsoc.net/about/Profile/" target="_blank"><i class="iconfont icon-guanyuwomen01"></i>公司简介</a></li> -->
            <!-- <li><a hidefocus="true" href="http://www.icsoc.net/outsourcingcallcenter/Phonenumber/" target="_blank"><i class="iconfont icon-tongxin"></i>通信资源</a></li>
            <li>
                </i><a hidefocus="true" href="http://www.icsoc.net/communications/communicationsone/" target="_blank"><i class="iconfont icon-19"></i>云通信</a></li> -->
            <!-- <li><a hidefocus="true" href="http://www.icsoc.net/outsourcingcallcenter/" target="_blank"><i class="iconfont icon-kefuzhongxin"></i>呼叫中心外包</a></li> -->
            <li><a hidefocus="true" href="javascript:return false;" target="_blank"><i class="iconfont icon-kefuzhongxin"></i>呼叫中心外包</a></li>
        </ul>
        <div class="footer-top-right">
            <div class="footer-top-font"> <span>扫一扫关注微信公众号</span><br/> 或搜 "嗨学网" </div>
            <div class="footer-top-ewm"></div>
        </div>
    </div>
    <div class="footer">
        <div xmlns="http://www.w3.org/1999/xhtml">Copyright © ICSOC Corporation All Rights 中通天鸿（北京）通信科技有限公司
            <p class="beian"><i></i>京ICP备12018589号</p>
        </div>
    </div>
</div>
{% block javascript %}
    <!--[if !IE]> -->
    <script src="{{ asset('bundles/icsocui/js/jquery.min.js') }}"></script>
    <!-- <![endif]-->
    <!--[if lte IE 9]>
    <script src="{{ asset('bundles/icsocui/js/jquery-1.11.1.min.js') }}"></script>
    <![endif]-->
    {% javascripts
    'bundles/icsocui/js/bootstrap.min.js'
    %}
    <script type="text/javascript" src="{{ asset_url }}"></script>
    {% endjavascripts %}
    <script type="text/javascript">
        $(document).ready(function() {
            $('body').keydown(function(event){
                if(event.keyCode == 13){
                    sendData();
                }
            });

            if ($('#vcc_code').val() == '') {
                $('#vcc_code').focus();
            } else {
                $('#password').focus();
            }

            $("#qcode-title").click(function () {
                window.location.href = "http://e.icsoc.net";
            });
        });

        /**
         * ajax发送数据
         */
        function sendData()
        {
            if ($('#vcc_code').val() == '') {
                $('#vcc_code').focus();
                $('#vcccode_tip').children('span').html('企业账号为空');
                $('#vcccode_tip').css('display', '');
                setTimeout(function () {
                    $('#vcccode_tip').children('span').html('');
                    $('#vcccode_tip').css('display', 'none');
                }, 3000);
                return false;
            }

            if ($('#user_name').val() == '') {
                $('#user_name').focus();
                $('#username_tip').children('span').html('用户名为空');
                $('#username_tip').css('display', '');
                setTimeout(function () {
                    $('#username_tip').children('span').html('');
                    $('#username_tip').css('display', 'none');
                }, 3000);
                return false;
            }

            if ($('#password').val() == '') {
                $('#password').focus();
                $('#password_tip').children('span').html('登录密码为空');
                $('#password_tip').css('display', '');
                setTimeout(function () {
                    $('#password_tip').children('span').html('');
                    $('#password_tip').css('display', 'none');
                }, 3000);
                return false;
            }

            if ($('#captcha').val() == '') {
                $('#captcha').focus();
                $('#captcha_tip').children('span').html('验证码为空');
                $('#captcha_tip').css('display', '');
                setTimeout(function () {
                    $('#captcha_tip').children('span').html('');
                    $('#captcha_tip').css('display', 'none');
                }, 3000);
                return false;
            }

            var _user_name = $('#user_name').val();
            var _password = $('#password').val();
            var ccode = $('#vcc_code').val();
            var captcha = $('#captcha').val();
            var remember = '&_remember_me=1';
            $('#loginBtn').attr('disabled', true);
            $.ajax({
                type:'POST',
                url: "{{ path('icsoc_security_check_login') }}",
                data:"_username="+ccode+"&_password="+_password+'&captcha='+captcha+'&admin_user='+_user_name+remember,
                dataType:"json",
                success: function(responce) {
                    if (responce.error) {
                        if (responce.message == '验证码错误') {
                            $('#captcha').focus();
                            $('#captcha_tip').children('span').html(responce.message);
                            $('#captcha_tip').css('display', '');
                            setTimeout(function () {
                                $('#captcha_tip').children('span').html('');
                                $('#captcha_tip').css('display', 'none');
                            }, 3000);
                        } else if (responce.message == '无效的用户名' || responce.message == '账户未启用') {
                            $('#user_name').focus();
                            $('#username_tip').children('span').html(responce.message);
                            $('#username_tip').css('display', '');
                            setTimeout(function () {
                                $('#username_tip').children('span').html('');
                                $('#username_tip').css('display', 'none');
                            }, 3000);
                        } else if (responce.message == '无效的密码') {
                            $('#password').focus();
                            $('#password_tip').children('span').html(responce.message);
                            $('#password_tip').css('display', '');
                            setTimeout(function () {
                                $('#password_tip').children('span').html('');
                                $('#password_tip').css('display', 'none');
                            }, 3000);
                        }
                        $('#loginBtn').attr('disabled', false);
                        reload();
                    } else {
                        $('#btn_signin').html("登录中 <i class='iconfont icon-jiazai1'></i>");
                        window.parent.location.href = responce.target_path;
                    }
                }
            });
        }

        /**
         * 刷新验证码
         */
        function reload () {
            var img = document.getElementById('captcha_img');
            img.src = '{{ path('gregwar_captcha.generate_captcha', {key:'login'}) }}?n=' + (new Date()).getTime();
        }
    </script>
{% endblock %}
<script type="text/javascript" src="{{ asset('bundles/icsocui/js/vue.min.js') }}"></script>
<script type="text/javascript" src="{{ asset('bundles/icsocui/js/login-all-min.js') }}"></script>
{% block footer %}
{% endblock %}
</body>
</html>